package top.shenluw.springdemo.jpa;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Version;

/**
 * @author Shenluw
 * created：2019/7/22 11:56
 */
@Entity
public class User {
	@Id
	private Integer id;
	private String  name;
	private Integer age;

//	@Version
//	private Integer version;
//
//	public Integer getVersion() {
//		return version;
//	}
//
//	public User setVersion(Integer version) {
//		this.version = version;
//		return this;
//	}

	public Integer getId() {
		return id;
	}

	public User setId(Integer id) {
		this.id = id;
		return this;
	}

	public String getName() {
		return name;
	}

	public User setName(String name) {
		this.name = name;
		return this;
	}

	public Integer getAge() {
		return age;
	}

	public User setAge(Integer age) {
		this.age = age;
		return this;
	}


	@Override
	public String toString() {
		return "User{" +
				"id=" + id +
				", name='" + name + '\'' +
				", age=" + age +
				'}';
	}
}
